<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>图片类名等属性</title>
    <style>
        .active{
            border: 3px solid pink;
        }
    </style>
</head>
<body>
    <div class="bind">
        <img src="" alt="" width="500px" v-bind:src="isPic" :title="isTitle+'!'">
        <br>
        <img src="" alt="" width="600px" :src="isPic" :title="isTitle+'~~~'" @click="surprise" :class="isActive?'active':''">
        <br>
        <img src="" alt="" width="550px" :src="isPic" :title="isTitle+'!!!'" @click="surprise" :class="{active:!isActive}">
    </div>

</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var bind=new Vue({
        el:".bind",
        data:{
            isPic:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597001925089&di=e89ef903ef0f536c18c933bc303e1041&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201502%2F10%2F20150210205122_F3xhr.jpeg",
            isTitle:"魔法少女小圆",
            isActive:false
        },
        methods:{
            surprise:function(){
                this.isActive=!this.isActive;
            }
        }

    })
</script>
</html>